package com.gz.exception;

public enum SystemCode implements ResultCode {
    // 定义枚举对象
    SUCCESS(200, "操作成功"),
    SUCCESS_SMS(200, "发送手机验证码成功"),
    SUCCESS_LOGOUT(200, "注销成功"),
    SUCCESS_EMAIL(200, "邮件发送成功"),
    SUCCESS_CART(200, "添加购物车成功"),
    SUCCESS_CART_UPDATE(200, "购物车信息更新成功"),
    SUCCESS_CART_DELETE_ITEM(200, "购物车删除信息成功"),
    SUCCESS_CLEAR_CART(200, "清空购物车成功"),
    SUCCESS_ADD_ADDRESS(200, "添加地址成功"),
    SUCCESS_ADD_ORDER(200, "生成新订单成功"),
    SUCCESS_ADD_STORAGE(200, "添加收藏成功"),
    SUCCESS_CANCEL_STORAGE(200, "取消收藏成功"),
    SUCCESS_PAY(200, "支付成功"),
    SUCCESS_CANCEL_ORDER(200, "取消订单成功"),
    SUCCESS_DELETE_ORDER(200, "删除订单成功"),
    FAIL(500, "操作失败");

    private Integer code;
    private String message;

    SystemCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 获取状态码
     */
    @Override
    public Integer getCode() {
        return this.code;
    }

    /**
     * 获取状态信息
     */
    @Override
    public String getMessage() {
        return this.message;
    }
}
